<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="crmfn" uri='http://www.leo365.com' %>
<html>
<head>
    <title>员工管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <%@include file="common.jsp"%>
    <script type="text/javascript" src="/js/views/employee.js"></script>
</head>
<body>
    <table id="emp_datagrid"></table>

    <%--新增或更新对话框--%>
    <div id="emp_dialog">
        <form id="emp_form" method="post">
            <table align="center" style="margin-top: 15px">
                <%--隐藏域,如果编辑的时候,会把id的值放到这里--%>
                <input type="hidden" name="id"/>
                <tr>
                    <td>姓名</td>
                    <td><input type="text" name="username" /></td>
                </tr>
                <tr>
                    <td>真实姓名</td>
                    <td><input type="text" name="realname" /></td>
                </tr>
                <tr>
                    <td>电话</td>
                    <td><input type="text" name="tel" /></td>
                </tr>
                <tr>
                    <td>邮箱</td>
                    <td><input type="text" name="email" /></td>
                </tr>
                <tr>
                    <td>部门</td>
                    <%--这里的name写dept相当于把属性转成department再取出id--%>
                    <td><input  class="easyui-combobox" name="dept.id" data-options="valueField:'id',textField:'name',url:'/department_queryForEmployee'"></td>
                </tr>
                <tr>
                    <td>入职时间</td>
                    <td><input type="text" name="inputtime" class="easyui-datebox" /></td>
                </tr>
                <tr>
                    <td>角色</td>
                    <td>
                        <%--这里的做法和上面的部门类似，easyui-combobox 在data-options里面可以指定各种属性--%>
                        <input id="roles" class="easyui-combobox" data-options="valueField:'id',textField:'name',url:'/role_queryForEmployee',multiple: true"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>


    <div id="emp_datagrid_tb">
        <%--数据表格的顶部按钮--%><%--在这里做按钮权限--%>
        <div>
            <c:if test="${crmfn:checkPermission('com.lcd.ssm.web.controller.EmployeeController:save')}">
                <a class="easyui-linkbutton" iconCls="icon-add" plain="true" data-cmd="add">增加</a>
            </c:if>
            <c:if test="${crmfn:checkPermission('com.lcd.ssm.web.controller.EmployeeController:update')}">
                <a id="emp_datagrid_edit" class="easyui-linkbutton" iconCls="icon-edit" plain="true" data-cmd="edit">编辑</a>
            </c:if>
            <c:if test="${crmfn:checkPermission('com.lcd.ssm.web.controller.EmployeeController:delete')}">
                <a id="emp_datagrid_del" class="easyui-linkbutton" iconCls="icon-remove" plain="true" data-cmd="delEmployee">离职</a>
            </c:if>
            <c:if test="${crmfn:checkPermission('com.lcd.ssm.web.controller.EmployeeController:queryForPage')}">
                <a class="easyui-linkbutton" iconCls="icon-reload" plain="true" data-cmd="reload">刷新</a>
            </c:if>
        </div>
        <%--关键字搜索--%>
        <div>
            关键字搜索<input type="text" name="keyWord"><a class="easyui-linkbutton"  iconCls="icon-search" data-cmd="employeeSerach">搜索</a>
        </div>
    </div>

    <%--对话框的底部按钮--%>
    <div id="emp_dialog_bt">
        <a class="easyui-linkbutton" iconCls="icon-save" plain="true" data-cmd="save">保存</a>
        <a class="easyui-linkbutton" iconCls="icon-cancel" plain="true" data-cmd="cancel">取消</a>
    </div>
</body>
</html>
